#include "my_stdio.h"
#include "my_string.h"
#include <string.h>
#include <unistd.h>

int main()
{
    MyFile *filep = MyFopen("./log.txt", "a");
    if(!filep)
    {
        perror("fopen error!\n");
        return 1;
    }

    int cnt = 10;
    while(cnt--)
    {
        char *msg = (char*)"Ciallo~~~~~";
        MyFwrite(filep, msg, strlen(msg));
        MyFFlush(filep);
        printf("buffer:%s\n", filep->outbuffer);
        sleep(1);
    }

    MyFclose(filep);

    const char *str = "Ciallo!~\n";
    printf("strlen: %d\n", my_strlen(str));


    return 0;
}
